--用户表增加组织ID字段
ALTER TABLE dbo.t_User ADD	FOrgid int NOT NULL CONSTRAINT DF_t_User_FOrgid DEFAULT 0
--现金单据表

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Bill_Cash ADD
	FOrgid int NOT NULL CONSTRAINT DF_Bill_Cash_FOrgid DEFAULT 0
GO
ALTER TABLE dbo.Bill_Cash
	DROP CONSTRAINT PK_Bill_Cash
GO
ALTER TABLE dbo.Bill_Cash ADD CONSTRAINT
	PK_Bill_Cash_1 PRIMARY KEY CLUSTERED 
	(
	id
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO
ALTER TABLE dbo.Bill_Cash SET (LOCK_ESCALATION = TABLE)
GO
COMMIT
--商品收据表
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Bill_Product ADD
	FOrgid int NOT NULL CONSTRAINT DF_Bill_Product_FOrgid DEFAULT 0
GO
ALTER TABLE dbo.Bill_Product
	DROP CONSTRAINT PK_Bill_Product
GO
ALTER TABLE dbo.Bill_Product ADD CONSTRAINT
	PK_Bill_Product_1 PRIMARY KEY CLUSTERED 
	(
	id
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO
ALTER TABLE dbo.Bill_Product SET (LOCK_ESCALATION = TABLE)
GO
COMMIT
--物业收据表
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Bill_Property ADD
	FOrgid int NOT NULL CONSTRAINT DF_Bill_Property_FOrgid DEFAULT 0
GO
ALTER TABLE dbo.Bill_Property
	DROP CONSTRAINT PK_Bill_Property
GO
ALTER TABLE dbo.Bill_Property ADD CONSTRAINT
	PK_Bill_Property_1 PRIMARY KEY CLUSTERED 
	(
	id
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO
ALTER TABLE dbo.Bill_Property SET (LOCK_ESCALATION = TABLE)
GO
COMMIT
--水费收据表
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Bill_Water ADD
	FOrgid int NOT NULL CONSTRAINT DF_Bill_Water_FOrgid DEFAULT 0
GO
ALTER TABLE dbo.Bill_Water
	DROP CONSTRAINT PK_Bill_Water
GO
ALTER TABLE dbo.Bill_Water ADD CONSTRAINT
	PK_Bill_Water_1 PRIMARY KEY CLUSTERED 
	(
	id
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO
ALTER TABLE dbo.Bill_Water SET (LOCK_ESCALATION = TABLE)
GO
COMMIT
